Require turbo for forked workers only when running from a phar - #6263
Merged
Conversation
The turbo requirement existed for the phar-fork-guard: libphar serves phar:// reads through one shared per-archive fd whose seek cursor forked children race on. Outside a phar there is nothing to guard - and no turbo is lost by forking either, because the distributed binaries only exist next to a phar, so spawned workers of a source checkout run without turbo too, while an ini-loaded extension is inherited by fork like any other. Source-checkout installs - including phpstan-src's own self-analysis - now fork their workers and skip the per-worker application re-boot. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GnwgpaeUXRkgSDyg95tfK8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The turbo requirement in
ForkParallelCheckerexists for the phar-fork-guard — libphar servesphar://reads through one shared per-archive fd whose seek cursor forked children race on. Outside a phar there is nothing to guard, so the check now demands the active extension only underPhar::running().Nothing is lost by forking without turbo either: the distributed binaries only exist next to a phar, so spawned workers of a source checkout run without turbo too — and an ini-loaded extension is inherited by fork like any other extension.
Net effect: source-checkout installs — including phpstan-src's own self-analysis in CI and locally — fork their workers and skip the per-worker application re-boot.
phpstan diagnoseon this checkout (turbo not loaded) now reportsMechanism: fork (pcntl_fork); self-analysis and the full test suite are green through the fork path.🤖 Generated with Claude Code
https://claude.ai/code/session_01GnwgpaeUXRkgSDyg95tfK8